package com.example.Service;

import com.example.Dao.UserDao;
import com.example.pojo.User;

import java.sql.SQLException;

public class UserService {
    UserDao userDao =new UserDao();
    //登录验证
    public User check_login(User u) {
    User user =userDao.getUser(u);
    return  user;
    }
    //注册
    public int reg(User u){
        int flag =0;
    try {
        flag = userDao.insertUser(u);
    }catch (Exception e) {

    }
        return flag;
    }
    public int forget(User u){
        int flag =0;
        try {
            flag = userDao.UpdateUser(u);
        }catch (Exception e) {

        }
        return flag;
    }
    //忘记密码
}
